<style>
.el-tabs--card {
  height: calc(100vh - 140px);
}

.el-tab-pane {
  height: calc(100vh - 140px);
  overflow-y: auto;
}
</style>
<template>
  <div>
    <el-tabs v-model="activeName">
      <el-tab-pane label="角色信息" name="roleList">
        <role-list ref="roleList"/>
      </el-tab-pane>
      <el-tab-pane label="添加角色" name="roleAddNew">
        <role-add-new ref="roleAddNew" @changeTab="changeTab"/>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import roleList from "@/views/backState/staff/role/roleList.vue";
import roleAddNew from "@/views/backState/staff/role/roleAddNew.vue";

export default {
  name: "managerMain",
  components: {
    roleList,
    roleAddNew
  },
  data() {
    return {
      activeName: 'roleList',
    }
  },
  methods: {
    changeTab(name) {
      this.activeName = name;
      this.$refs.roleList.loadRole();
      this.$refs.roleAddNew.resetForm();
    }
  }
}
</script>